package com.honey.compilation.sql;

import com.honey.core.builder.CharacterBuilder;
import com.honey.core.builder.CharacterBuilderFactory;
import com.honey.core.compiler.IndentSpace;

/**
 * 空白行
 * @author Administrator
 *
 */
public class NewLineScript implements SqlScript{

	/** 空白行的行数*/
	public int line = 1;
	
	/**
	 * 构造函数
	 */
	public NewLineScript(){
		
	}
	
	/**
	 * 构造函数
	 * @param line 空白行的行数
	 */
	public NewLineScript(int line ){
		if(line <= 100 && line >= 1){
			this.line = line;
		}
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.core.dom.CompilationElement#compiledContent(int)
	 */
	@Override
	public CharacterBuilder compiledContent(int indentLevel ){
		CharacterBuilder answer = CharacterBuilderFactory.createC16StringBuilder();
		for(int i = 0 ; i < line;i++ )
			IndentSpace.newLine(answer);
		return answer;
	}
}
